package com.leo;

import com.leo.view.LoginView;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @BelongsProject: leo-emailfx
 * @BelongsPackage: com.leo
 * @Author: wangss
 * @CreateTime: 2023-02-12  22:36
 * @Description: 邮箱客户端
 * @Version: 1.0
 */
@Slf4j
public class EmailFxApp extends Application {

    public static ExecutorService executorService;

    public static void main(String[] args) {
        launch(args);
    }

    @Override
    public void start(Stage primaryStage) {
        StackPane root = new LoginView();
        Scene scene = new Scene(root);
        primaryStage.initStyle(StageStyle.TRANSPARENT);
        primaryStage.setScene(scene);
        primaryStage.setResizable(true);
        primaryStage.show();
    }

    @Override
    public void init() throws Exception {
        super.init();
        executorService = Executors.newCachedThreadPool();
    }

    @Override
    public void stop() throws Exception {
        super.stop();
        executorService.shutdown();
    }
}
